
#include "AnMainwin.h"
#include "AnGlobal.h"
#include "_SetMainpageCallback.h"

void * _set_mainpage_cb;    //接受系统信号和请求回应的示例
void * _screencap_cb;

void AnMainwin::setMainpage()
{
//设置总览页面
    //初始化
    _set_mainpage_cb = (void *) new _SetMainpageCallback(this);
    _screencap_cb = (void *) new _ScreencapCallback(this);
    //绑定信号槽
    QObject::connect(sys_callback, SIGNAL(connect_build()),
                     (_SetMainpageCallback *) _set_mainpage_cb, SLOT(connect_build()));
    QObject::connect(sys_callback, SIGNAL(connect_close()),
                     (_SetMainpageCallback *) _set_mainpage_cb, SLOT(connect_close()));
    QObject::connect(mp->pushButton_screenshot_refresh, SIGNAL(clicked()),
                     (_ScreencapCallback *) _screencap_cb, SLOT(refresh_clicked()));
    QObject::connect(mp->pushButton_screenshot_save, SIGNAL(clicked()),
                     (_ScreencapCallback *) _screencap_cb, SLOT(save_clicked()));
    QObject::connect(sys_callback, SIGNAL(connect_close()),
                     (_ScreencapCallback *) _screencap_cb, SLOT(connect_close()));
    QObject::connect(sys_callback, SIGNAL(connect_build()),
                     (_ScreencapCallback *) _screencap_cb, SLOT(refresh_clicked()));

    mp->label_screenshot->setAlignment(Qt::AlignCenter);
    mp->label_screenshot->setPixmap(((_ScreencapCallback *)_screencap_cb)->device_not_connect);

}
